package com.hdw.med.utils;

import com.hdw.med.MedConstant;
import com.hdw.med.bean.vo.SelectFldVO;
import org.apache.commons.lang3.StringUtils;

public class MedUtil {

    //1 小数,2 整数,3 百分数,4 比值
    public static String getValueFld(Byte euValtp) {
        if(euValtp==1) { //小数插入fl
            return MedConstant.VALUE_FLOAT;
        } else if(euValtp==2) { //小数插入fl
            return MedConstant.VALUE_INT;
        }
        return null;
    }

    public static String betweenSelAndFromSql(SelectFldVO fldVO) {
        String valueName = fldVO.getValueAlias()==null?fldVO.getValueFld():fldVO.getValueAlias();
        return "select "+fldVO.getDimsAndNames()+fldVO.getValue()+" "+valueName+","+fldVO.getDay()+" from ";
    }
}
